This article is about fog and transparency. Deferred rendering is not good at transparency. To compensate for it, Unreal Engine has specific material settings.
Fog
There are two types of fog. Both fade out according to height and depth. Pixel shader is used to compute.
- Performance Atmospheric > Exponentional (By default)
- Color blend Exponentional > Atmospgeric
It is recommended to use Atmospheric Fog for most cases. If you need to maximize performance, you can also disable Exponential Fog in the project settings.
Transparency
Deferred rendering is not good at transparency. However it\’s the case of any engine, not just UE4. So we don\’t worry about this part. And because the engine has this weakness, transparency is computed at the end of rendering. In addition, since transparency processing is so difficult, the engine has specific materials settings to compensate for it.
Let\’s take a look at the material editor .
You can check at Transparency > Lighting Mode.
1. VolumetricPerVertex Directional
- 〇 Good quality.
- × Low performance.
2. VolumetricPerVertex NonDirectional
- 〇 Good quality.
- × Low performance.
- Adding ambient lighting etc.
3. Surface ForwardShading
- 〇 Best quality.
- × Lowest performance.
What does Volumetric mean?
To divide the surface or mesh. UE4 virtually divides the mesh. The actual model is split at the time of rendering without additional processing. And then it\’s used for light blending. If the layers overlap, the processing becomes even more heavy.
How to optimize fog and transparency?
- Set Blend Mode to Masked instead of Translusent whenever possible.
- If you need to use Translusent, set the view mode to Unlit instead of Default Lit.
- Use transparency only when you really need it, and try using other way of expressing to fake transparency.
Case 1 :Need to increase the quality of transparency with deferred rendering.
There is a method of processing part of transparency processing by forward rendering and merging with deferred rendering. Even though Performance is expensive, quality is better.